#!/usr/bin/python
# -*- coding: UTF-8 -*-

class WindowUtils(object):
    @staticmethod
    def get_screen_size(window):
        return window.winfo_screenwidth(), window.winfo_screenheight()

    @staticmethod
    def get_window_size(window):
        return window.winfo_reqwidth(), window.winfo_reqheight()

    @staticmethod
    def center_window(root, width, height):
        screenwidth = root.winfo_screenwidth()
        screenheight = root.winfo_screenheight()
        size = '%dx%d+%d+%d' % (width, height, (screenwidth - width) / 2, (screenheight - height) / 2)
        root.geometry(size)